/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.teste;

import br.com.modelo.Editora;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author egberto
 */
public class GerarTabelas {
    
    public static void main(String args[]){
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("default");
        
        EntityManager em = emf.createEntityManager();
        
        Editora novaEditora = new Editora();
        novaEditora.setNome("K19 - Livros");
        novaEditora.setEmail("contato@k19.com.br");
        
        em.getTransaction().begin();
        em.persist(novaEditora);
        em.getTransaction().commit();
        emf.close();
    }
    
}
